package com.sgy.ssm.controller;

import com.sgy.ssm.pojo.Account;
import com.sgy.ssm.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/account")
public class AccountController {

    /*
    * spring容器和springmvc容器是有层次关系的
    * spring容器：service对象和dao对象
    * springmvc容器：controller对象
    * */

    @Autowired
    private AccountService accountService;

    @RequestMapping("/queryAll")
    @ResponseBody
    public List<Account> queryAll() {
        return accountService.queryAccountList();
    }
}
